<?php
namespace frontend\modules\Api\services;

use Yii;
/**
 * Class CommonService
 * @package frontend\modules\Api\services
 */
class CommonService
{
    /**
     * @param $phone
     * @param $code
     * @throws
     * @return boolean
     * 检查验证码输入是否正确
     */
    public static function checkSmsCode($phone,$code)
    {
        $cacheCode = Yii::$app->get('redis')->get('Sms:'.$phone);
        return $code == $cacheCode ;
    }
}
